﻿SeadragonJSViewer = function(container) {
    /// <summary>Creates a Seadragon.Viewer inside the given HTML element.</summary>
    /// <param name="container">HTML element that will be injected with the control</param>
    /// <field name="elmt" type="Object">The HTML element containing this viewer and its controls. Note that this is not the same HTML element that is passed into the constructor; the distinction is important for full page mode. The specifics of this element and its children are unspecified and implementation-dependent.</field>
    /// <field name="drawer" type="SeadragonJSDrawer">If content is open, this points to the Seadragon.Drawer instance that renders the content. Otherwise, this is null.</field>
    /// <field name="profiler" type="SeadragonJSProfiler">If content is open, this points to a Seadragon.Profiler instance that is profiling each update. Otherwise, this is null.</field>
    /// <field name="source" type="SeadragonJSTileSource">If content is open, this points to the Seadragon.TileSource instance for the content. Otherwise, this is null.</field>
    /// <field name="viewport" type="SeadragonJSViewport">If content is open, this points to the Seadragon.Viewport instance for the content. Otherwise, this is null.</field>

    /// <returns type="Object"></returns>
}

SeadragonJSRect.prototype =
{
    elmt: null,
    drawer: null,
    profiler: null,
    source: null,
    viewport: null,


    //Content
    isOpen: function() {
        /// <summary>Returns true if content is currently open.</summary>
        /// <returns type="Boolean"></returns>
    },

    openDzi: function(xmlUrl, xmlString) {
        /// <summary>Asynchronously opens the DZI from the XML file at the given URL. If the contents of the XML are also given as a string, the XML is not actually downloaded; otherwise, it is. (The location of the XML is needed in either case to determine the location of the tiles.) Exactly one "open", "error" or "ignore" event is guaranteed to fire upon completion.</summary>
        /// <param name="xmlUrl" type="String"></param>
        /// <param name="xmlString" type="String"></param>
    },

    openTileSource: function(tileSource) {
        /// <summary>Asynchronously opens the given Seadragon.TileSource instance. Exactly one "open", "error", or "ignore" event is guaranteed to fire upon completion.</summary>
        /// <param name="tileSource" type="SeadragonJSTileSource"></param>
    },

    close: function() {
        /// <summary>Close any content.</summary>
    },

    //Controls
    addControl: function(elmt, anchor) {
        /// <summary>Adds the given HTML element as a control to the viewer. The element is optionally anchored to a corner of the container based on the given Seadragon.ControlAnchor value. If no anchor is supplied, or if the anchor is ControlAnchor.NONE, the element is absolutely positioned inside the container.</summary>
        /// <param name="elmt" type="String"></param>
        /// <param name="anchor" type="SeadragonJSControlAnchor" optional="true"></param>
    },

    removeControl: function(elmt) {
        /// <summary>Removes the given control element.</summary>
        /// <param name="elmt" type="String"></param>
    },

    clearControls: function() {
        /// <summary>Remove all controls.</summary>
    },

    getNavControl: function() {
        /// <summary>Returns the <div> element for the default navigation control. The specific buttons in this control are children of this element, e.g. the first child is the zoom in button.</summary>
        /// <returns type="Object"></returns>
    },

    isOpen: function() {
        /// <summary>Returns true if content is currently open.</summary>
        /// <returns type="Boolean"></returns>
    },

    //User Interface
    isDashboardEnabled: function() {
        /// <summary>Returns true if the dashboard is currently enabled. The dashboard includes all of the controls.</summary>
        /// <returns type="Boolean"></returns>

    },

    isFullPage: function() {
        /// <summary>Returns true if the viewport is currently full page.</summary>
        /// <returns type="Boolean"></returns>

    },

    isMouseNavEnabled: function() {
        /// <summary>Returns true if the default mouse navigation is currently enabled.</summary>
        /// <returns type="Boolean"></returns>

    },

    isVisible: function() {
        /// <summary>Returns true if the viewer is currently visible.</summary>
        /// <param name="elmt" type="String"></param>
    },

    setDashboardEnabled: function(visible) {
        /// <summary>Sets whether the dashboard should be enabled. The dashboard includes all of the controls.</summary>
        /// <param name="visible" type="Boolean"></param>
    },

    setFullPage: function(fullPage) {
        /// <summary>Sets whether the viewport should be full page.</summary>
        /// <param name="fullPage" type="Boolean"></param>
    },

    setDashboardEnabled: function(enabled) {
        /// <summary>Sets whether the default mouse navigation should be enabled.</summary>
        /// <param name="visible" type="Boolean"></param>
    },

    setVisible: function(visible) {
        /// <summary>Sets whether the viewer should be visible.</summary>
        /// <param name="visible" type="Boolean"></param>
    },

    //Event handling
    addEventListener: function(eventName, handler) {
        /// <summary>Adds the given handler function as a listener for the event with the given name. This function will receive this Viewer instance as a parameter.</summary>

    },

    removeEventListener: function(eventName, handler) {
        /// <summary>Removes the given handler function as a listener for the event with the given name.</summary>

    }
}
